package com.changgou.goods.dao;

import com.changgou.goods.pojo.Sku;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.common.Mapper;

/**
 * @author:hushengjin
 * @date:2019-07-29 16:15:14
 */
public interface SkuMapper extends Mapper<Sku> {

    @Update("UPDATE tb_sku SET num=num-#{num} WHERE id=#{id} AND num>=#{num}")
    int decrCount(@Param("id") Long id, @Param("num") Integer num);

}
